import React,{Component} from 'react'
import PropTypes from 'prop-types'
// import hello from './index.module.css'
import Item from '../Item'
export default class List extends Component{
	static propTypes = {
		todos: PropTypes.array.isRequired,
		changeToduList: PropTypes.func.isRequired,
		deleteTodo: PropTypes.func.isRequired
	}
	render(){
		const {todos, changeToduList,deleteTodo} = this.props
		// console.log('todos', todos)
		return (
			<div className="listBox" style={{padding:'20px 0'}}>
				{
					todos.map((item, index) => {
						return <Item key={item.id} {...item} index={index} changeToduList={changeToduList} deleteTodo={deleteTodo}/>
					})
				}
				
			</div>
		)
	}
}